import router from "@/router"

export default {
    TOGGLE(state) {  // 侧边栏开关的且切换！
        state.collapse = !state.collapse
    },
    SETUSERINFO(state,data){
        // 存入本地
        localStorage.setItem("userinfo", JSON.stringify(data))
        // 赋给state
        state.userinfo = data
    },
    QUIT(state){
        localStorage.removeItem("userinfo");
        state.userinfo = {};
        router.push("/login")
    }
}